<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="(item,index) in urlList" :key="index"><img class="bannerImg" :src="urlList[index]" alt=""></van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { swipe } from '@/api/shouye'
export default {
  name: 'SwipeNb',
  data () {
    return {
      urlList: []
    }
  },
  methods: {
    async GetSwipe () {
      const res = await swipe()
      console.log('res', res)
      for (let i = 0; i < res.body.length; i++) {
        this.urlList.push(`http://124.223.73.204:8080${res.body[i].imgSrc}`)
        // console.log('图片', this.urlList[i])
      }
    }
  },
  mounted () {
    this.GetSwipe()
  }
}
</script>

<style scoped lang='less'>
.my-swipe .van-swipe-item {
  color: #fff;
  font-size: 20px;
  line-height: 150px;
  text-align: center;
  background-color: white;
  height: 212px;
}
.bannerImg{
    width:375px;
    height: 212px;
}

</style>
